package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.Size;

/**
 * 用户信息实体类
 *
 * @author ruoyi
 */
public class User extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 用户ID */
    private Long userId;

    /** 微信OpenID */
//    @NotBlank(message = "OpenID不能为空")
    @Size(min = 0, max = 100, message = "OpenID长度不能超过100个字符")
    private String openid;

    /** 手机号 */
//    @NotBlank(message = "手机号不能为空")
    @Size(min = 0, max = 11, message = "手机号长度不能超过11个字符")
    private String phone;

    /** 添加人 */
    private String createUser;

    /** 更新人 */
    private String updateUser;

    public User() {}

    public User(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("openid", getOpenid())
                .append("phone", getPhone())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("createUser", getCreateUser())
                .append("updateUser", getUpdateUser())
                .toString();
    }
}
